/*
 * @Author: HuangBingQuan <17671241237@163.com>
 * @Date: 2024-12-24 12:55:42
 * @LastEditTime: 2025-01-16 15:54:43
 * @FilePath: /low-code-platform/src/router/index.ts
 */

import { createRouter, createWebHistory } from 'vue-router';
import HomeView from '@/views/Home/index.vue';
// console.log((import.meta as any).env.BASE_URL);

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            name: 'Home',
            component: HomeView,
        },
        {
            path: '/materials',
            name: 'Materials',
            component: () => import('@/views/MaterialsView/index.vue'),
            redirect: '/select-group',
            children: [
                {
                    path: '/select-group',
                    name: 'select-group',
                    component: () => import('@/views/MaterialsView/child/SelectGroupView.vue'),
                    children: [
                        {
                            path: '/single-select',
                            name: 'single-select',
                            component: () =>
                                import(
                                    '@/components/SurveyComs/Materials/SelectComs/SingleSelect.vue'
                                ),
                        },
                        {
                            path: '/multi-select',
                            name: 'multi-select',
                            component: () =>
                                import(
                                    '@/components/SurveyComs/Materials/SelectComs/MultiSelect.vue'
                                ),
                        },
                        {
                            path: '/option-select',
                            name: 'option-select',
                            component: () =>
                                import(
                                    '@/components/SurveyComs/Materials/SelectComs/OptionSelect.vue'
                                ),
                        },
                        {
                            path: '/single-pic-select',
                            name: 'single-pic-select',
                            component: () =>
                                import(
                                    '@/components/SurveyComs/Materials/SelectComs/SinglePicSelect.vue'
                                ),
                        },
                        {
                            path: '/multi-pic-select',
                            name: 'multi-pic-select',
                            component: () =>
                                import(
                                    '@/components/SurveyComs/Materials/SelectComs/MultiPicSelect.vue'
                                ),
                        },
                    ],
                },
                {
                    path: '/input-group',
                    name: 'input-group',
                    component: () => import('@/views/MaterialsView/child/InputGroupView.vue'),
                },
                {
                    path: '/advanced-group',
                    name: 'advanced-group',
                    component: () => import('@/views/MaterialsView/child/AdvancedGroupView.vue'),
                },
                {
                    path: '/note-group',
                    name: 'note-group',
                    component: () => import('@/views/MaterialsView/child/NoteGroupView.vue'),
                },
                {
                    path: '/personal-info-group',
                    name: 'personal-info-group',
                    component: () =>
                        import('@/views/MaterialsView/child/PersonalInfoGroupView.vue'),
                },
                {
                    path: '/contact-group',
                    name: 'contact-group',
                    component: () => import('@/views/MaterialsView/child/ContactGroupView.vue'),
                },
            ],
        },
        {
            path: '/editor',
            name: 'Editor',
            component: () => import('@/views/EditorView/index.vue'),
        },
    ],
});

export default router;
